﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cmsservice.Entity;

namespace cmsservice.DAL
{
    public class QQGssjWebUserInfoDAL
    {
        public int AddqQGssjWebUserInfo(QQGssjWebUserInfo qQGssjWebUserInfo)
        {
            try
            {
                Tools tools = new Tools();

                tools.AddSqlParameter("MobileCodeBinary", System.Data.SqlDbType.VarBinary, qQGssjWebUserInfo.MobileCodeBinary);
                tools.AddSqlParameter("MobileCodeShow", System.Data.SqlDbType.VarChar, qQGssjWebUserInfo.MobileCodeShow);
                tools.AddSqlParameter("Password", System.Data.SqlDbType.VarChar, qQGssjWebUserInfo.Password);
                tools.AddSqlParameter("BuyTime", System.Data.SqlDbType.DateTime, qQGssjWebUserInfo.BuyTime);
                tools.AddSqlParameter("ExpireTime", System.Data.SqlDbType.DateTime, qQGssjWebUserInfo.ExpireTime);

                string sql = "INSERT INTO QQGssjWebUserInfo(MobileCodeBinary,MobileCodeShow,Password,BuyTime,ExpireTime) VALUES(@MobileCodeBinary,@MobileCodeShow,@Password,@BuyTime,@ExpireTime)";

                return SqlHelper.ExecuteNonQuery(DBConn.TemporaryDB, System.Data.CommandType.Text, sql, tools.GetSqlParameters());
            }
            catch (Exception ex)
            {
                return 0;
            }
            
        }
    }
}
